package com.eazyimage.lab.service;

import com.eazyimage.lab.mapper.VerifygenMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.eazyimage.lab.entity.Dataset_;

import java.util.List;

@Service
public class Verifygenservice {
    @Autowired
    VerifygenMapper vm;


    public String Generateverify(int Datasetid){

        String ori = vm.Toverify( Datasetid);
        Md5Service md = new Md5Service();
        String verify = md.start(ori);
        //System.out.print("\n");System.out.print(verify);System.out.print("\n");
        while(vm.Verifyonly(verify)!=0)
        {
            ori = ori+"1";
            verify = "";
            md = new Md5Service();
            verify = md.start(ori);
        }
        vm.GenerateVerify(verify,Datasetid);
        return verify;
    }
    public Dataset_ Findbyverify(String verify){
        return vm.Findbyverify(verify);
    }

}
